package com.alittle.module.function;

import android.content.Context;
import android.text.TextUtils;

import com.alittle.core.LittleRouter;
import com.alittle.core.ParentCache;
import com.alittle.mvp.func.ISplashPresenter;
import com.alittle.mvp.func.ISplashView;

import com.alittle.support.support.mvp.MvpBasePresenter;

/**
 * Created by wom on 2015/8/17.
 */
public class SplashPresenter extends MvpBasePresenter<ISplashView> implements ISplashPresenter {


    @Override
    public Boolean checkLoginState(Context context) {

        String phone = ParentCache.getInstance(context).getPhone();

        if (TextUtils.isEmpty(phone)) {

            LittleRouter.routeToLogin(context);
            return false;

        } else {
            LittleRouter.routeToPanelHost(context);
            return true;

        }
    }
}
